﻿using SlamDunk.CMS.Model.Base;
using SlamDunk.CMS.Model.ViewModel;

namespace SlamDunk.CMS.Model.DataModel
{
    /// <summary>
    /// 相册
    /// </summary>
    public class PhotoAlbum : BaseEntity
    {
        #region # 属性

        #region 相册名称 —— string AlbumName
        /// <summary>
        /// 相册名称
        /// </summary>
        public string AlbumName { get; set; }
        #endregion

        #region 作者 —— string Author
        /// <summary>
        /// 作者
        /// </summary>
        public string Author { get; set; }
        #endregion

        #region 来源 —— string Source
        /// <summary>
        /// 来源
        /// </summary>
        public string Source { get; set; }
        #endregion

        #region 封面 —— string Cover
        /// <summary>
        /// 封面
        /// </summary>
        public string Cover { get; set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
        #endregion

        #region 排序 —— int Sort
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
        #endregion

        #endregion

        #region # 方法

        #region 转换为视图模型 —— PhotoAlbumView ToViewModel()
        /// <summary>
        /// 转换为视图模型
        /// </summary>
        /// <returns>视图模型</returns>
        public PhotoAlbumView ToViewModel()
        {
            return new PhotoAlbumView()
            {
                Id = this.Id,
                AlbumName = this.AlbumName,
                Author = this.Author,
                Source = this.Source,
                Cover = this.Cover,
                Description = this.Description,
                Sort = this.Sort,
                AddTime = this.AddTime.ToString("yyyy-MM-dd HH:mm:ss"),
            };
        }
        #endregion

        #endregion
    }
}
